/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.pengjunlee.hive.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Schedule 工具类
 * 
 * @author liupan
 * @version 2019-1-23
 */


@Lazy
@Component
public class ScheduleUtils {
	  private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");

	  @Scheduled(fixedDelayString = "5000")
	  public void getTask1() {
	    System.out.println("任务1，当前时间：" + dateFormat.format(new Date()));
	  }

	  @Scheduled(cron = "0/5 * *  * * ?")
	  public void getTask2() {
	    System.out.println("任务2，当前时间：" + dateFormat.format(new Date()));
	  }
}
